package com.bytes32.parsing;

import com.bytes32.classification.tree.dataset.AttributeType;
import com.bytes32.classification.tree.dataset.FeatureType;
/**
 * Every successful intoText and intoNumber scores 1 point 
 * in the weight
 * 
 * This will score 1 point for unordered (assumed string)
 * and always fail for ordered in intoNumber
 * @author murariuf
 *
 */
public class LabelParser extends AbstractParser<String> {

	@Override
	public String intoText(String value) throws ParsingException {
		if (value == null)
			throw new ParsingException("Unable to parse null");
		return value;
	}

	@Override
	public Number intoNumber(String value) throws ParsingException {
		throw new ParsingException("No number representation");
	}
	
	
	@Override
	public AttributeType getAttributeType() {
		return AttributeType.TEXT;
	}
	
	@Override
	public FeatureType getFeatureType() {
		return FeatureType.UNORDERED;
	}
	
}
